
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/wait.h>
#include <sys/types.h>




#include "DYSvrNetMan.h"

using namespace std;


static int run_server = 1;
void sig_handle(int signo)
{
	run_server = 0;
	return ;    
}

int main(int argc , char *argv[])
{
	printf("\n** server begin...");

	
	signal(SIGINT, sig_handle); 


	printf("\n** QQ server start...");


	DYSvrNetMan xNetSvrMan;
	xNetSvrMan.SetConnectTime( 5000,10 );
	xNetSvrMan.SetListen( 9000,9001,9002 );

	xNetSvrMan.SvrStart();


	printf("\n** QQ server start success...");


	printf("\n**Hit ctrl+c to exit");
	
	while( run_server )
	{
		sleep( 5 );
	}

	printf("\n** exit......");
	
    xNetSvrMan.SvrStop();


	printf("\n** exit success!");

	return 0 ;
}
